package pe.edu.upc.grupotec.jms;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.test.context.ContextConfiguration;

import pe.edu.upc.grupotec.model.Ticket;

import com.google.gson.Gson;


public class ColaCompraTicket {

	@Autowired
	private JmsTemplate jmsTemplate;
	

	public void grabarTicket(Ticket ticket){
		try {
			Gson gson = new Gson();
			jmsTemplate.convertAndSend("cola_grupotec",gson.toJson(ticket));	
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
